package com.buss.base.service.impl;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.buss.base.dao.CompanyDao;
import com.buss.base.model.Company;
import com.buss.base.service.CompanyService;
import com.buss.core.dic.RecordStatus;
import com.buss.core.persistence.Paginalbe;
import com.buss.core.persistence.ResultList;

@Service
public class CompanyServiceImpl implements CompanyService {

	@Autowired
	private CompanyDao companyDao;
	
	//@Override
	public void saveCompany(Company company) {
		company.setAddDate(new Date());
		companyDao.saveCompany(company);
	}

	@Override
	public void editCompany(Company company) {
		companyDao.editCompany(company);
	}

	@Override
	public void updateStatus(String[] ids, RecordStatus status) {
		companyDao.updateStatus(ids, status);
	}

	@Override
	public Company loadCompany(String id) {		
		return companyDao.loadCompany(id);
	}

	@Override
	public ResultList<Company> queryCompany(String name, String pinyin,
			String address, Paginalbe page) {
		return companyDao.queryCompany(name, pinyin, address, page);
	}

	@Override
	public void removeCompany(String[] ids) {
		
		companyDao.removeCompany(ids);
	}

}
